package com.lion.ball.modules.orderfood.service.assistants.converters;

import java.sql.Timestamp;
import com.lion.common.base.utils.ConvertUtil;
import com.lion.common.base.utils.DbUtil;
import com.lion.common.spring.annotations.DataConverter;
import com.lion.common.spring.business.base.BaseConverter;
import com.lion.utils.TimeUtil;
import com.lion.ball.modules.orderfood.domain.entity.OfdTableDynamicEntity;
import com.lion.ball.modules.orderfood.web.model.params.create.OfdTableDynamicCreateParam;
import com.lion.ball.modules.orderfood.web.model.params.update.OfdTableDynamicUpdateParam;
import com.lion.ball.modules.orderfood.web.model.results.OfdTableDynamicResult;

/**
 * @author Chris Chan
 * Create on 2025-10-18 13:33
 * Use for: 桌位动态数据 业务数据转换助手
 * Explain:
 * 
 */
@DataConverter
public class OfdTableDynamicConverter implements BaseConverter<
        OfdTableDynamicEntity,
        OfdTableDynamicCreateParam,
        OfdTableDynamicUpdateParam,
        OfdTableDynamicResult> {
    @Override
    public OfdTableDynamicEntity fromParam(OfdTableDynamicCreateParam param) {
        OfdTableDynamicEntity entity = new OfdTableDynamicEntity();
        ConvertUtil.copyProperties(param, entity, "id");
        return entity;
    }

    @Override
    public OfdTableDynamicEntity fromUpdateParam(OfdTableDynamicUpdateParam param) {
        OfdTableDynamicEntity entity = ConvertUtil.convert(param, OfdTableDynamicEntity.class);
        return entity;
    }

    @Override
    public OfdTableDynamicResult toResult(OfdTableDynamicEntity entity) {
        OfdTableDynamicResult result = ConvertUtil.convert(entity,OfdTableDynamicResult.class);
        return result;
    }
}